package org.orbroker.callback

trait LogEmbeddedValues {
  def embedValues(sql: String, parms: Seq[Any]): String = {
    var returnSql = sql
    for (parm ← parms) {
      val sqlParm = parm match {
        case _@(_: CharSequence | _: java.util.Date) ⇒ "'" + parm + "'"
        case _ ⇒ String.valueOf(parm)
      }
      returnSql = returnSql.replaceFirst("\\?", sqlParm)
    }
    returnSql
  }

}